﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Task Manager</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>
<P><FONT face=Courier><STRONG><FONT 
color=#0000ff>Receiving Full Path of Process<BR></FONT></STRONG>foreach (Process 
p in Process.GetProcesses()){<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
try{<BR> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//This throws error for some 
processes<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (<FONT color=#ff0000>p.MainModule.FileName.ToLower().</FONT>EndsWith(ExeName, 
StringComparison.CurrentCultureIgnoreCase)){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//Do some 
stuff<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}</FONT></P>
<P><FONT 
face=Courier>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}catch 
(Exception){&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//Acess denied&nbsp; 
<BR> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR> }</FONT></P>
<P><FONT 
face=Courier>------------------------------------------------------------------------------------------------------------------</FONT></P></body>
</html>
